﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPages_FrontEnd : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {       
        //If PreferredTheme cookie exists set theme in dropdown list
        if (!Page.IsPostBack)
        {
            //string selectedTheme = Page.Theme;
            //HttpCookie preferredTheme = Request.Cookies.Get("PreferredTheme");
            //if (preferredTheme != null)
            //{
            //    selectedTheme = preferredTheme.Value;
            //}
            //if (!string.IsNullOrEmpty(selectedTheme) && ddlTheme.Items.FindByValue(selectedTheme) != null)
            //{
            //    ddlTheme.Items.FindByValue(selectedTheme).Selected = true;
            //}
        }
    }
    //protected void ddlTheme_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    HttpCookie preferredTheme = new HttpCookie("PreferredTheme");
    //    preferredTheme.Expires = DateTime.Now.AddMonths(3);
    //    preferredTheme.Value = ddlTheme.SelectedValue;
    //    Response.Cookies.Add(preferredTheme);
    //    //Need to redirect for theme to go into effect
    //    Response.Redirect(Request.Url.ToString());
    //}
}
